package qianFeng.day1;

public class out_arr_element {

    public static void main(String[] args) {
        int arr[]={12,23,34,45,56,45,13};
        System.out.println("输入数组元素：");
        for (int element:arr)
            System.out.print("  "+element);
        System.out.println("数组元素之和为："+new out_arr_element().sum_arr(arr));
    }
    public int sum_arr(int array[]){
        int sum=0;
        for (int i=0;i<array.length;i++)
            sum+=array[i];
        return sum;
    }
}
